home *** CD-ROM | disk | FTP | other *** search
-
-
-
- XXXXmmmmGGGGeeeettttPPPPiiiixxxxmmmmaaaappppBBBByyyyDDDDeeeepppptttthhhh((((3333XXXX)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV XXXXmmmmGGGGeeeettttPPPPiiiixxxxmmmmaaaappppBBBByyyyDDDDeeeepppptttthhhh((((3333XXXX))))
-
-
-
- NNNNAAAAMMMMEEEE
- XXXXmmmmGGGGeeeettttPPPPiiiixxxxmmmmaaaappppBBBByyyyDDDDeeeepppptttthhhh - A pixmap caching function that
- generates a pixmap, stores it in a pixmap cache, and returns
- the pixmap
-
- SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- #include <Xm/Xm.h>
- PPPPiiiixxxxmmmmaaaapppp XXXXmmmmGGGGeeeettttPPPPiiiixxxxmmmmaaaappppBBBByyyyDDDDeeeepppptttthhhh(
- SSSSccccrrrreeeeeeeennnn ****ssssccccrrrreeeeeeeennnn,
- cccchhhhaaaarrrr ****iiiimmmmaaaaggggeeee____nnnnaaaammmmeeee,
- PPPPiiiixxxxeeeellll ffffoooorrrreeeeggggrrrroooouuuunnnndddd,
- PPPPiiiixxxxeeeellll bbbbaaaacccckkkkggggrrrroooouuuunnnndddd,
- iiiinnnntttt ddddeeeepppptttthhhh);
-
- VVVVEEEERRRRSSSSIIIIOOOONNNN
- This page documents Motif 2.1.
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- XXXXmmmmGGGGeeeettttPPPPiiiixxxxmmmmaaaappppBBBByyyyDDDDeeeepppptttthhhh uses the parameter data to perform a
- lookup in the pixmap cache to see if a pixmap has already
- been generated that matches the data. If one is found, a
- reference count is incremented and the pixmap is returned.
- Applications should use XXXXmmmmDDDDeeeessssttttrrrrooooyyyyPPPPiiiixxxxmmmmaaaappppwhen the pixmap is no
- longer needed.
-
- _s_c_r_e_e_n Specifies the display screen on which the pixmap
- is to be drawn
-
- _i_m_a_g_e__n_a_m_e
- Specifies the name of the image to be used to
- generate the pixmap
-
- _f_o_r_e_g_r_o_u_n_d
- Combines the image with the _f_o_r_e_g_r_o_u_n_d color to
- create the pixmap if the image referenced is a
- bit-per-pixel image
-
- _b_a_c_k_g_r_o_u_n_d
- Combines the image with the _b_a_c_k_g_r_o_u_n_d color to
- create the pixmap if the image referenced is a
- bit-per-pixel image
-
- _d_e_p_t_h Specifies the depth of the pixmap
-
- If a matching pixmap is not found, _i_m_a_g_e__n_a_m_e is used to
- perform a lookup in the image cache. If an image is found,
- it is used to generate the pixmap, which is then cached and
- returned.
-
- If an image is not found, _i_m_a_g_e__n_a_m_e is used as a filename,
- and a search is made for an XXXX11110000 or XXXX11111111 bitmap file. If it is
- found, the file is read, converted into an image, and cached
-
-
-
- Page 1 (printed 10/3/02)
-
-
-
-
-
-
- XXXXmmmmGGGGeeeettttPPPPiiiixxxxmmmmaaaappppBBBByyyyDDDDeeeepppptttthhhh((((3333XXXX)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV XXXXmmmmGGGGeeeettttPPPPiiiixxxxmmmmaaaappppBBBByyyyDDDDeeeepppptttthhhh((((3333XXXX))))
-
-
-
- in the image cache. The image is then used to generate a
- pixmap, which is cached and returned.
-
- If _i_m_a_g_e__n_a_m_e has a leading / (slash), it specifies a full
- pathname, and XXXXmmmmGGGGeeeettttPPPPiiiixxxxmmmmaaaappppBBBByyyyDDDDeeeepppptttthhhh opens the file as
- specified. Otherwise, _i_m_a_g_e__n_a_m_e specifies a filename. In
- this case, XXXXmmmmGGGGeeeettttPPPPiiiixxxxmmmmaaaappppBBBByyyyDDDDeeeepppptttthhhh looks for the file along a
- search path specified by the XXXXBBBBMMMMLLLLAAAANNNNGGGGPPPPAAAATTTTHHHH environment
- variable or by a default search path, which varies depending
- on whether or not the XXXXAAAAPPPPPPPPLLLLRRRREEEESSSSDDDDIIIIRRRR environment variable is
- set. The default search path contains a lot of directories.
- Therefore, XXXXmmmmGGGGeeeettttPPPPiiiixxxxmmmmaaaappppBBBByyyyDDDDeeeepppptttthhhh will need a relatively long
- time to search through all these directories for pixmaps and
- bitmaps. Applications that use a lot of pixmaps and bitmaps
- will probably run more quickly if XXXXBBBBMMMMLLLLAAAANNNNGGGGPPPPAAAATTTTHHHH is set to a
- short list of directories. In addition to X bitmap files
- (XBM), Motif also supports XPM (X Pixmap) file formats. The
- XXXXBBBBMMMMLLLLAAAANNNNGGGGPPPPAAAATTTTHHHH specifies the path for both XBM and XPM files.
- XPM files are described in more detail later in this
- reference page.
-
- The XXXXBBBBMMMMLLLLAAAANNNNGGGGPPPPAAAATTTTHHHH environment variable specifies a search path
- for X bitmap files. It can contain the substitution field
- %%%%BBBB, where the _i_m_a_g_e__n_a_m_eargument to XXXXmmmmGGGGeeeettttPPPPiiiixxxxmmmmaaaappppBBBByyyyDDDDeeeepppptttthhhh is
- substituted for %%%%BBBB. It can also contain the substitution
- fields accepted by XXXXttttRRRReeeessssoooollllvvvveeeePPPPaaaatttthhhhnnnnaaaammmmeeee. The substitution
- field %%%%TTTT is always mapped to _b_i_t_m_a_p_s, and %%%%SSSS is always
- mapped to NULL.
-
- If XXXXBBBBMMMMLLLLAAAANNNNGGGGPPPPAAAATTTTHHHH is not set, but the environment variable
- XXXXAAAAPPPPPPPPLLLLRRRREEEESSSSDDDDIIIIRRRR is set, the following pathnames are searched:
-
- +o %%%%BBBB
-
- +o $$$$XXXXAAAAPPPPPPPPLLLLRRRREEEESSSSDDDDIIIIRRRR////%%%%LLLL////bbbbiiiittttmmmmaaaappppssss////%%%%NNNN////%%%%BBBB
-
- +o $$$$XXXXAAAAPPPPPPPPLLLLRRRREEEESSSSDDDDIIIIRRRR////%%%%llll____%%%%tttt////bbbbiiiittttmmmmaaaappppssss////%%%%NNNN////%%%%BBBB
-
- +o $$$$XXXXAAAAPPPPPPPPLLLLRRRREEEESSSSDDDDIIIIRRRR////%%%%llll////bbbbiiiittttmmmmaaaappppssss////%%%%NNNN////%%%%BBBB
-
- +o $$$$XXXXAAAAPPPPPPPPLLLLRRRREEEESSSSDDDDIIIIRRRR////bbbbiiiittttmmmmaaaappppssss////%%%%NNNN////%%%%BBBB
-
- +o $$$$XXXXAAAAPPPPPPPPLLLLRRRREEEESSSSDDDDIIIIRRRR////%%%%LLLL////bbbbiiiittttmmmmaaaappppssss////%%%%BBBB
-
- +o $$$$XXXXAAAAPPPPPPPPLLLLRRRREEEESSSSDDDDIIIIRRRR////%%%%llll____%%%%tttt////bbbbiiiittttmmmmaaaappppssss////%%%%BBBB
-
- +o $$$$XXXXAAAAPPPPPPPPLLLLRRRREEEESSSSDDDDIIIIRRRR////%%%%llll////bbbbiiiittttmmmmaaaappppssss////%%%%BBBB
-
- +o $$$$XXXXAAAAPPPPPPPPLLLLRRRREEEESSSSDDDDIIIIRRRR////bbbbiiiittttmmmmaaaappppssss////%%%%BBBB
-
- +o $$$$HHHHOOOOMMMMEEEE////bbbbiiiittttmmmmaaaappppssss////%%%%BBBB
-
-
-
-
- Page 2 (printed 10/3/02)
-
-
-
-
-
-
- XXXXmmmmGGGGeeeettttPPPPiiiixxxxmmmmaaaappppBBBByyyyDDDDeeeepppptttthhhh((((3333XXXX)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV XXXXmmmmGGGGeeeettttPPPPiiiixxxxmmmmaaaappppBBBByyyyDDDDeeeepppptttthhhh((((3333XXXX))))
-
-
-
- +o $$$$HHHHOOOOMMMMEEEE////%%%%BBBB
-
- +o ////uuuussssrrrr////lllliiiibbbb////XXXX11111111////%%%%LLLL////bbbbiiiittttmmmmaaaappppssss////%%%%NNNN////%%%%BBBB
-
- +o ////uuuussssrrrr////lllliiiibbbb////XXXX11111111////%%%%llll____%%%%tttt////bbbbiiiittttmmmmaaaappppssss////%%%%NNNN////%%%%BBBB
-
- +o ////uuuussssrrrr////lllliiiibbbb////XXXX11111111////%%%%llll////bbbbiiiittttmmmmaaaappppssss////%%%%NNNN////%%%%BBBB
-
- +o ////uuuussssrrrr////lllliiiibbbb////XXXX11111111////bbbbiiiittttmmmmaaaappppssss////%%%%NNNN////%%%%BBBB
-
- +o ////uuuussssrrrr////lllliiiibbbb////XXXX11111111////%%%%LLLL////bbbbiiiittttmmmmaaaappppssss////%%%%BBBB
-
- +o ////uuuussssrrrr////lllliiiibbbb////XXXX11111111////%%%%llll____%%%%tttt////bbbbiiiittttmmmmaaaappppssss////%%%%BBBB
-
- +o ////uuuussssrrrr////lllliiiibbbb////XXXX11111111////%%%%llll////bbbbiiiittttmmmmaaaappppssss////%%%%BBBB
-
- +o ////uuuussssrrrr////lllliiiibbbb////XXXX11111111////bbbbiiiittttmmmmaaaappppssss////%%%%BBBB
-
- +o ////uuuussssrrrr////iiiinnnncccclllluuuuddddeeee////XXXX11111111////bbbbiiiittttmmmmaaaappppssss////%%%%BBBB
-
- If neither XXXXBBBBMMMMLLLLAAAANNNNGGGGPPPPAAAATTTTHHHH nor XXXXAAAAPPPPPPPPLLLLRRRREEEESSSSDDDDIIIIRRRR is set, the following
- pathnames are searched:
-
- +o %%%%BBBB
-
- +o $$$$HHHHOOOOMMMMEEEE////%%%%LLLL////bbbbiiiittttmmmmaaaappppssss////%%%%NNNN////%%%%BBBB
-
- +o $$$$HHHHOOOOMMMMEEEE////%%%%llll____%%%%tttt////bbbbiiiittttmmmmaaaappppssss////%%%%NNNN////%%%%BBBB
-
- +o $$$$HHHHOOOOMMMMEEEE////%%%%llll////bbbbiiiittttmmmmaaaappppssss////%%%%NNNN////%%%%BBBB
-
- +o $$$$HHHHOOOOMMMMEEEE////bbbbiiiittttmmmmaaaappppssss////%%%%NNNN////%%%%BBBB
-
- +o $$$$HHHHOOOOMMMMEEEE////%%%%LLLL////bbbbiiiittttmmmmaaaappppssss////%%%%BBBB
-
- +o $$$$HHHHOOOOMMMMEEEE////%%%%llll____%%%%tttt////bbbbiiiittttmmmmaaaappppssss////%%%%BBBB
-
- +o $$$$HHHHOOOOMMMMEEEE////%%%%llll////bbbbiiiittttmmmmaaaappppssss////%%%%BBBB
-
- +o $$$$HHHHOOOOMMMMEEEE////bbbbiiiittttmmmmaaaappppssss////%%%%BBBB
-
- +o $$$$HHHHOOOOMMMMEEEE////%%%%BBBB
-
- +o ////uuuussssrrrr////lllliiiibbbb////XXXX11111111////%%%%LLLL////bbbbiiiittttmmmmaaaappppssss////%%%%NNNN////%%%%BBBB
-
- +o ////uuuussssrrrr////lllliiiibbbb////XXXX11111111////%%%%llll____%%%%tttt////bbbbiiiittttmmmmaaaappppssss////%%%%NNNN////%%%%BBBB
-
- +o ////uuuussssrrrr////lllliiiibbbb////XXXX11111111////%%%%llll////bbbbiiiittttmmmmaaaappppssss////%%%%NNNN////%%%%BBBB
-
- +o ////uuuussssrrrr////lllliiiibbbb////XXXX11111111////bbbbiiiittttmmmmaaaappppssss////%%%%NNNN////%%%%BBBB
-
- +o ////uuuussssrrrr////lllliiiibbbb////XXXX11111111////%%%%LLLL////bbbbiiiittttmmmmaaaappppssss////%%%%BBBB
-
-
-
- Page 3 (printed 10/3/02)
-
-
-
-
-
-
- XXXXmmmmGGGGeeeettttPPPPiiiixxxxmmmmaaaappppBBBByyyyDDDDeeeepppptttthhhh((((3333XXXX)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV XXXXmmmmGGGGeeeettttPPPPiiiixxxxmmmmaaaappppBBBByyyyDDDDeeeepppptttthhhh((((3333XXXX))))
-
-
-
- +o ////uuuussssrrrr////lllliiiibbbb////XXXX11111111////%%%%llll____%%%%tttt////bbbbiiiittttmmmmaaaappppssss////%%%%BBBB
-
- +o ////uuuussssrrrr////lllliiiibbbb////XXXX11111111////%%%%llll////bbbbiiiittttmmmmaaaappppssss////%%%%BBBB
-
- +o ////uuuussssrrrr////lllliiiibbbb////XXXX11111111////bbbbiiiittttmmmmaaaappppssss////%%%%BBBB
-
- +o ////uuuussssrrrr////iiiinnnncccclllluuuuddddeeee////XXXX11111111////bbbbiiiittttmmmmaaaappppssss////%%%%BBBB
-
- These paths are defaults that vendors may change. For
- example, a vendor may use different directories for
- ////uuuussssrrrr////lllliiiibbbb////XXXX11111111 and ////uuuussssrrrr////iiiinnnncccclllluuuuddddeeee////XXXX11111111.
-
- The following substitutions are used in these paths:
-
- %%%%BBBB The image name, from the _i_m_a_g_e__n_a_m_e argument
-
- %%%%NNNN The class name of the application
-
- %%%%LLLL The display's language string. This string is
- influenced by XXXXttttSSSSeeeettttLLLLaaaannnngggguuuuaaaaggggeeeePPPPrrrroooocccc. The default
- string is determined by calling setlocale(_L_C__A_L_L,
- _N_U_L_L).
-
- %%%%llll____%%%%tttt The language and territory component of the
- display's language string
-
- %%%%llll The language component of the display's language
- string
-
- The contents of the file must conform to the rules for X11
- bitmap files. In other words, Motif can read any X11
- conformant bitmap file.
-
- The XPM file format is used for storing or getting back
- colored X pixmaps from files. The XPM library is provided as
- unsupported with Motif. To build applications without XPM,
- use the _N_O__X_P_M macro. The following shows both XBM and XPM
- files, respectively, for a plaid pattern.
-
- /* XBM file */
- #define plaid_width 22
- #define plaid_height 22
- #define plaid_x_hot -1
- #define plaid_y_hot -1
- static char plaid_bits[] = {
- 0x75, 0xfd, 0x3f, 0xaa, 0xfa, 0x3e, 0x75, 0xfd, 0x3f, 0xaa, 0xfa, 0x3e,
- 0x75, 0xfd, 0x3f, 0xff, 0x57, 0x15, 0x75, 0xfd, 0x3f, 0xaa, 0xfa, 0x3e,
- 0x75, 0xfd, 0x3f, 0xaa, 0xfa, 0x3e, 0x75, 0xfd, 0x3f, 0x20, 0xa8, 0x2b,
- 0x20, 0x50, 0x15, 0x20, 0xa8, 0x2b, 0x20, 0x50, 0x15, 0x20, 0xa8, 0x2b,
- 0xff, 0xff, 0x3f, 0x20, 0xa8, 0x2b, 0x20, 0x50, 0x15, 0x20, 0xa8, 0x2b,
- 0x20, 0x50, 0x15, 0x20, 0xa8, 0x2b};
-
-
-
-
- Page 4 (printed 10/3/02)
-
-
-
-
-
-
- XXXXmmmmGGGGeeeettttPPPPiiiixxxxmmmmaaaappppBBBByyyyDDDDeeeepppptttthhhh((((3333XXXX)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV XXXXmmmmGGGGeeeettttPPPPiiiixxxxmmmmaaaappppBBBByyyyDDDDeeeepppptttthhhh((((3333XXXX))))
-
-
-
- /* XPM file */
- static char * plaid[] = {
- /* plaid pixmap
- * width height ncolors chars_per_pixel */
- "22 22 4 2 ",
- /* colors */
- " c red m white s light_color ",
- "Y c green m black s lines_in_mix ",
- "+ c yellow m white s lines_in_dark ",
- "x m black s dark_color ",
- /* pixels */
- "x x x x x x x x x x x x + x x x x x ",
- " x x x x x x x x x x x x x x x x ",
- "x x x x x x x x x x x x + x x x x x ",
- " x x x x x x x x x x x x x x x x ",
- "x x x x x x x x x x x x + x x x x x ",
- "Y Y Y Y Y x Y Y Y Y Y + x + x + x + x + x + ",
- "x x x x x x x x x x x x + x x x x x ",
- " x x x x x x x x x x x x x x x x ",
- "x x x x x x x x x x x x + x x x x x ",
- " x x x x x x x x x x x x x x x x ",
- "x x x x x x x x x x x x + x x x x x ",
- " x x x x Y x x x ",
- " x x x Y x x ",
- " x x x x Y x x x ",
- "x x x x x x x x x x x x x x x x x x x x x x ",
- " x x x x Y x x x ",
- " x x x Y x x ",
- " x x x x Y x x x ",
- " x x x Y x x ",
- " x x x x Y x x x "
- };
-
- RRRREEEETTTTUUUURRRRNNNN
- Returns a pixmap when successful; returns
- XXXXmmmmUUUUNNNNSSSSPPPPEEEECCCCIIIIFFFFIIIIEEEEDDDD____PPPPIIIIXXXXMMMMAAAAPPPPif the image corresponding to _i_m_a_g_e__n_a_m_e
- cannot be found.
-
- RRRREEEELLLLAAAATTTTEEEEDDDD
- XXXXmmmmDDDDeeeessssttttrrrrooooyyyyPPPPiiiixxxxmmmmaaaapppp(3), XXXXmmmmIIIInnnnssssttttaaaallllllllIIIImmmmaaaaggggeeee(3), and
- XXXXmmmmUUUUnnnniiiinnnnssssttttaaaallllllllIIIImmmmaaaaggggeeee(3).
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Page 5 (printed 10/3/02)
-
-
-
-